﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Remoting;
using commonlib;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Threading;

namespace commonlib
{
    public class CentralDirectoryServer
    {

        static CentralDirectory thisCentralDirectory;

         [STAThread]
        static void Main(string[] args)
        {
            if (args.Count() > 2)
            {
                thisCentralDirectory = new CentralDirectory(args[0], args[1], Convert.ToInt16(args[2]));
                thisCentralDirectory.initServices();
            }
            else
            {
                Console.WriteLine("Não foram passados parametros suficientes para iniciar o Central Directory.");
            }


             /*
              * 
            DataStore ds = new DataStore();
            ds.put("aa", "bb", DateTime.Now.Ticks);
            Thread.Sleep(500);
            ds.put("aa", "bb", DateTime.Now.Ticks);
            Thread.Sleep(500);
            long txid = DateTime.Now.Ticks;
            ds.put("aa", "bb", txid);

            Console.WriteLine(ds);
            Console.WriteLine(txid);
            Console.WriteLine(ds.get("aa",txid));

             */

            Console.ReadKey();
            
        }
         
    }
}

